package com.shelpe.services.lexicon.configuration;

import java.util.List;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

import com.shelpe.services.lexicon.properties.AutoDriveParams;
import com.shelpe.services.lexicon.service.filter.IntersectionKeywordRecommendsFilter;
import com.shelpe.services.lexicon.service.filter.SeasonMatchingKeywordFilter;
import com.shelpe.services.lexicon.service.filter.SexMatchingKeywordFilter;
import com.shelpe.services.lexicon.service.filter.support.BlackListKeywordRecommendFilter;
import com.shelpe.services.lexicon.service.filter.support.KeywordRecommendFilter;
import com.shelpe.services.lexicon.service.filter.support.PVRecommendMetricFilter;
import com.shelpe.services.lexicon.service.filter.support.SimilarityRecommendMetricFilter;
import com.shelpe.services.lexicon.service.filter.support.WordKeywordRecommendFilter;

@Configuration
@EnableConfigurationProperties(AutoDriveParams.class)
public class AppConfiguration {
	
	@Bean
	@Order(1)
	public SeasonMatchingKeywordFilter seasonFilter(){
		return new SeasonMatchingKeywordFilter();
	}
	
	@Bean
	@Order(2)
	public SexMatchingKeywordFilter sexFilter(){
		return new SexMatchingKeywordFilter();
	}
	
	@Bean
	@Order(1)
	public WordKeywordRecommendFilter wordSizeFilter(){
		return new WordKeywordRecommendFilter();
	}
	@Bean
	@Order(2)
	public BlackListKeywordRecommendFilter blackFilter(){
		return new BlackListKeywordRecommendFilter();
	}
	@Bean
	@Order(3)
	public PVRecommendMetricFilter pvFilter(){
		return new PVRecommendMetricFilter();
	}
	@Bean
	@Order(4)
	public SimilarityRecommendMetricFilter similarityFilter(){
		return new SimilarityRecommendMetricFilter();
	}
	
	@Bean
	@Order(3)
	public IntersectionKeywordRecommendsFilter intersectionFilter(List<KeywordRecommendFilter> filters){
		IntersectionKeywordRecommendsFilter filter =  new IntersectionKeywordRecommendsFilter();
		filter.setFilters(filters);
		return filter;
	}
}
